import api from './request'
// 获取考试分类
export const getksfl = () => api({
    url: 'home/getFirstClassify',
    method: 'GET'
})
// 获取考试分类下分类
export const getksfl2 = (id) => api({
    url: 'home/getMajor/' + id,
    method: 'GET',
    params: {
        classify_id: id
    }
})
// 获取tab
export const gettab = (id) => api({
    url: 'home/getSecondClassify/' + id,
    method: 'GET',
    params: {
        classify_id: id
    }
})
// 获取轮播图
export const getlbt = (id) => api({
    url: `home/banner/${id}/4`,
    method: 'GET'
})
// 请求免费直播课
export const mfzb = (id) => api({
    url: 'home/recommendCourse/' + id,
    method: 'GET'
})
export const fybr = (id) => api({
    url: 'home/recommendCourse/' + id,
    method: 'GET',
    params: {
        classify_id: id
    }
})
// 搜索
export const lsss = (val) => api({
    url: 'home/classifyCourse/1',
    method: 'GET',
    params: {
        val,
        classify_id: 1,
        title: val
    }
})
export const biaoti = (id) => api({
    url: 'home/marketingCourse/' + id,
    method: 'GET',
    params: {
        classify_id: id
    }
})
// 获取当前选中tab下的list
export const getlist = (id) => api({
    url: 'home/classifyCourse/' + id,
    method: 'GET',
    params: {
        classify_id: id,
        page: 1,
        limit: 15
    }
})
// 获取gkk页面事件
export const getgkk = (id) => api({
    url: 'home/marketingCoursePage/' + id,
    method: 'GET',
    params: {
        classify_id: id
    }
})
// 请求详情也数据
export const getxq = (id) => api({
    url: `courseInfo/basis_id=${id}/st=0`,
    method: 'GET',
    params: {
        basis_id: id,
        st: 1,
        channel: ''
    }
})
// 获取可签准备
export const getkqzb = (id) => api({
    url: 'getWechatInfo/' + id,
    method: 'GET',
    params: {
        id: id
    }
})
// 获取时间排序
export const getsjpx = (id) => api({
    url: 'courseInfo/orderByChapterList/' + id,
    method: 'GET',
    params: {
        course_id: id
    }
})
// 获取评价
export const getpj = (id) => api({
    url: 'getAllCommentByType',
    method: 'POST',
    data: {
        course_id: id,
        type: 1
    }
})
// 获取名师详情
export const getmsxq = (id) => api({
    url: 'teacherinfo',
    method: 'POST',
    data: {
        id: id
    }
})
// 获取所有课程
export const allkc = (id, page) => api({
    url: 'teacher/newCourseList',
    method: 'POST',
    data: {
        id: id,
        page: page
    }
})
// 获取所有讲师里的tab
export const getjstab = () => api({
    url: 'teacherClassify',
    method: 'GET',
    // params: {}
})
// 获取所有讲师
export const getsyjs = (id, page) => api({
    url: 'teacher',
    method: 'POST',
    data: {
        city_id: 0,
        is_pc: 1,
        limit: 15,
        province_id: 0,
        teacher_classfiy: id + '',
        page
    }
})
// 获取登录页图片资源
export const getlgtp = () => api({
    url: 'webConfig',
    method: 'GET'
})
// 获取验证码
export const postyzm = (mobile) => api({
    url: 'getsmscode',
    method: 'POST',
    data: {
        mobile,
        sms_type: 'login'
    }
})
// 获取login登录验证码
export const getyzm = () => api({
    url: 'getImgCode',
    method: 'GET'

})
export const login = (mobile, sms_code, captcha) => api({
    url: 'login',
    method: 'POST',
    data: {
        device_id: 1,
        device_type: 2,
        mobile: mobile,
        sms_code: sms_code,
        user_pass: '000000',
        captcha: captcha
    }

})
// 点击收藏
export const djsc = (id) => api({
    url: 'collect',
    method: 'POST',
    data: {
        basis_id: id + '',
        type: 1
    }
})
// 获取收货地址
export const getshdz = () => api({
    url: 'address',
    method: 'GET'
})
// 点击设为默认地址
export const szmrdz = (id) => api({
    url: 'address/is_def/address_id=' + id,
    method: 'GET',
    params: {
        address_id: id
    }
})
// 点击删除地址
export const deldz = (id) => api({
    url: 'address/' + id,
    method: 'DELETE'
})
// 获取所有省
export const getsheng = (parent_id = 0) => api({
    url: 'area/city',
    method: 'POST',
    data: {
        parent_id
    }
})
// // 获取县
// export const getsheng = (parent_id = 0) => api({
//     url: 'area/city',
//     method: 'POST',
//     data: {
//         parent_id
//     }
// })
//获取确认订单列表
export const getdd = (id) => api({
    url: 'order/shopinfo',
    method: 'POST',
    data: {
        advance_id: '',
        group_id: '',
        pay_type: '',
        shop_id: id,
        spell_id: '',
        type: 1
    }
})
// 获取我的收藏
export const getsc = () => api({
    url: 'collect',
    method: 'GET',

})
// 点击提交反馈
export const tjfk = (value, id) => api({
    url: 'feedbackadd',
    method: 'POST',
    data: {
        feedback_info: value,
        user_id: id
    }
})
// 获取当前日期下的课程
export const getdqkc = (time) => api({
    url: 'myCourse/weekList',
    method: 'GET',
    params: {
        '1654963200today_time': '',
        time: 1654963200,
        today_time: time
    }
})